<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
            #box1{
                width: 100px;
                height: 100px;
                background-color: red;
                margin: 50px auto;
            }
    </style>
</head>
   <div id="box">
       <button @click="show">{{msg?"显示":"消失"}}</button>
       <div id="box1" v-show="msg"></div>

   </div>
<body>
 
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.13/dist/vue.js"></script>
    <script>
       var vm = new Vue({
           el:"#box",
           data:{
               msg:true
           },
           methods:{
                show(){
                    this.msg=!this.msg
                }
           }
         
       })
       console.dir(vm)
    </script>
</body>
</html>